<?php
class Controller_Records extends Controller_Template 
{
    public function __construct ($req, $res)
    {
        $this->template = 'smarty:records/list';
        parent::__construct($req, $res);
    }

    public function action_show ($page = 1, $type = NULL, $uid = NULL)
    {
        $page  = max($page, 1);
        $limit = Kohana::config('records.page.size');
        $start = ($page - 1) * $limit;
        $counts= Records::counts($type);

        $this->template->set('logs', Records::get($start, $limit, $type));
        $this->template->set('pagination', $this->pagination($counts, $limit, 'route', 'param1', 'pagination/floating'));
    }
}
